package com.roncoo.education.course.feign.interfaces.score;

import java.io.Serializable;
import java.util.ArrayList;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import com.fasterxml.jackson.annotation.JsonFormat;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 * <p>
 * ADMIN-实验分数
 * </p>
 *
 * @author wujing
 */
@Data
@Accessors(chain = true)
@ApiModel(value = "AdminExperimentScoreReq", description = "ADMIN-实验分数添加")
public class CallbackExperimentScoreReq implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键")
    private Long id;

    @ApiModelProperty(value = "实验空间用户账号")
    @NotBlank(message = "数据错误：username 缺失")
    private String username;

    @ApiModelProperty(value = "实验名称：用户学习的实验名称（100字以内）")
    @NotBlank(message = "数据错误：title 缺失")
    private String title;

    @ApiModelProperty(value = "实验状态：1 - 完成；2 - 未完成")
    @NotNull(message = "数据错误：status 缺失")
    @Range(message = "数据错误：status格式错误", min = 1, max = 2)
    private Integer status;

    @ApiModelProperty(value = "实验成绩：0 ~100，百分制")
    @NotNull(message = "数据错误：score 缺失")
    private Integer score;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "实验开始时间：13位时间戳")
    @NotNull(message = "数据错误：startTime 缺失")
    private Long startTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "实验结束时间：13位时间戳")
    @NotNull(message = "数据错误：endTime 缺失")
    private Long endTime;

    @ApiModelProperty(value = "实验用时：非零整数，单位秒")
    @NotNull(message = "数据错误：timeUsed 缺失")
    private Integer timeUsed;

    @ApiModelProperty(value = "接入平台编号：由“实验空间”分配给实验教学项目的编号")
    @NotBlank(message = "数据错误：appid 缺失")
    private String appid;

    @ApiModelProperty(value = "实验平台实验记录ID：平台唯一且由大小写字母、数字、“_”组成")
    @NotBlank(message = "数据错误：originId 缺失")
    private String originId;

    @ApiModelProperty(value = "分组标识，最多20个字符")
    @Length(message = "数据错误：group_id超出20字符", max = 20)
    private String group_id;

    @ApiModelProperty(value = "分组名称，最多20个字符")
    @Length(message = "数据错误：group_name超出20字符", max = 20)
    private String group_name;

    @ApiModelProperty(value = "组里的角色，最多20个字符")
    @Length(message = "数据错误：role_in_group超出20字符", max = 20)
    private String role_in_group;

    @ApiModelProperty(value = "组员名称标识")
    @Length(message = "数据错误：group_members超出20字符", max = 20)
    private String group_members;

    @ApiModelProperty(value = "数据错误：实验平台自定义扩展数据")
    private String extData;
    
    @NotNull(message = "数据错误：steps 缺失")
    private @Valid ArrayList<CallbackExperimentScoreStepReq> steps;    
}
